





import { Route } from "react-router-dom"
import routeMap from "./routesMap"
export default function createRoute(routersArray){
    return routersArray.map((item)=>{
        if(item.children && item.children.length > 0){
            return <Route key={item.path} path={item.path} Component={routeMap[item.component]}>
                {createRoute(item.children)}
            </Route>
        }else{
            return <Route path={item.path} Component={routeMap[item.component]} key={item.path}></Route>
        }
       
    })
}